import {createRouter, createWebHistory} from 'vue-router'
import HomeView from '../views/HomeView.vue'

const OrdersView = () => import('../views/OrdersView.vue')
const PrivateView = () => import('../views/PrivateView.vue')
const SearchView = () => import('../views/SearchView.vue')
const MerchantsView = () => import('../views/MerchantsView.vue')
const DetailView = () => import('../views/DetailView.vue')

const OrderFood = () => import('../views/detail/OrderFood.vue')
const Assessment = () => import('../views/detail/Assessment.vue')
const Business = () => import('../views/detail/Business.vue')


const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            name: 'home',
            component: HomeView
        },
        {
            path: '/orders-view',
            name: 'orders-view',
            component: OrdersView
        },
        {
            path: '/private-view',
            name: 'private-view',
            component: PrivateView
        },
        {
            path: '/search-view',
            name: 'search-view',
            component: SearchView
        },
        {
            path: '/merchants-view',
            name: 'merchants-view',
            component: MerchantsView
        },
        {
            path: '/detail-view',
            name: 'detail-view',
            component: DetailView,
            children: [
                {
                    path:'',
                    component:OrderFood
                },
                {
                    path:'assessment',
                    component:Assessment
                },
                {
                    path:'business',
                    component:Business
                },
            ]
        },
    ]
})

export default router
